<div class="graybg">
	<header class="demo-header">
	    <div class="title3Left flt text-center header-small">
	        <a href="javascript:history.back(-1);" class="whiteC">
	        	<img src="/img/back.png" class="backimg">返回
	        </a>
	    </div>
	    <div class="title3Middle flt text-center">我的购买</div>
	</header>
	<div class="whitebg">
        <?php if($this ->order_res){?>
            <?php foreach ($this ->order_res as $v){?>
                <?php if(isset($v['order_code'])){ ?>
                    <div class="sizecolor flt">订单号：<?php echo $v['order_code']; ?></div><div class="frt zonge" style=""><?php echo $v['order_status']?></div>
                <?php }?>
                <div class="clear_both"></div>
                <div class="message-detail">
                    <?php if(isset($v['seller_uid']) && isset($this->order_res['user_list'][$v['seller_uid']])){?>
                        <p>卖家名称：<?php echo isset($v['seller_uid']) && isset($this->order_res['user_list'][$v['seller_uid']])?$this->order_res['user_list'][$v['seller_uid']]['nickname']:'';?></p>
                    <?php }?>
                    <?php if(isset($v['detail_list']['amount'])){?>
                        <p>产品数量：<?php echo $v['detail_list']['amount']?></p>
                    <?php }?>
                    <?php if(isset($v['contact'])){?>
                        <p style="padding-left: 3%;">收件人：<?php echo $v['contact'];?></p>
                    <?php }?>
                    <?php if(isset($v['tel'])){?>
                        <p>联系电话：<?php echo $v['tel'];?></p>
                    <?php }?>
                    <?php if(isset($v['insert_time'])){?>
                        <p>订单时间：<?php echo $v['insert_time'];?></p>
                    <?php }?>
                    <?php if(isset($v['adds'])){?>
                        <p>收货地址：<?php echo $v['adds']; ?></p>
                    <?php }?>
                    <?php if(isset($v['remark'])){?>
                        <p>备注信息：<span class="buy-beizhu"><?php echo $v['remark']?></span></p>
                    <?php }?>
                    <?php if(isset($v['logistics_name'])){?>
                        <?php if($v['order_status'] != '待配送'){?>
                            <p>物流方式：<?php echo $v['logistics_name']; ?></p>
                        <?php }?>
                    <?php }?>
                    <?php if(isset($v['logistics_numbers'])){?>
                        <?php if($v['order_status'] != '待配送'){?>
                            <p>物流单号：<span class="buy-beizhu"><?php echo $v['logistics_numbers']?></span></p>
                        <?php }?>
                    <?php }?>
                </div>
                <?php if(isset($v['total_price'])){?>
                    <div class="padding-adjust4 border1">
                        <div class="flt product">订单金额：<span class="money-color" style="font-size: 1.2em;"><strong>￥<?php echo $v['total_price'];?></strong></span></div>
                        <?php if($v['order_status'] != '已完成'){?>
                            <div onclick="CloseAccount(<?php echo $v['id']; ?>)" class="button-two Corange" style="border: 1px solid #EF5507;">确认收货</div><!--状态为配送中时可确认收货-->
                        <?php }?>
                    </div>
                <?php }?>
            <?php }?>
        <?php }?>
	</div>
</div>
<script>
    function CloseAccount($id){
        $("#account,#fadeAccount").fadeOut();
        $('body,.layout_content').css("overflow","");
        var express = $('#express').val();
        var id = $id;
        if (id) {
            var url = '/my/receipt';
            $.post(url,{'express':express,'id':id},function (res) {
                if(res.code != 200) {
                    console.log(res.massage);
                } else {
                    var index = layer.msg('确认收获成功', {icon: 16,shade: 0.01,time:1000000});
                    window.location.reload();
                }
            });
        }
    }
</script>